Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collections/UtilityMethodTestCase: sync with phpcs 3.x/PHP 8.0 identifier name tokens change #217

Merged
merged 2 commits into from
Sep 21, 2020

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Sep 20, 2020

Collections/various methods: sync with PHPCS

Upstream PR squizlabs/PHP_CodeSniffer#3063 which was merged for PHPCS 3.5.7 effectively "undoes" the PHP 8.0 tokenization for identifier names for PHPCS 3.x, while it also includes backfilling the PHP 8.0 token constants.

In PHPCS 4.x the PHP 8.0 tokenization will be backfilled instead.

This commit annotates this change in the Collections::nameTokens() method and updates the unit tests for various token collections to handle this correctly as well.

Refs:

UtilityMethodTestCase::usesPhp8NameTokens(): account for PHPCS 3.x "undoing" the PHP 8.0 identifier name tokenization

Upstream PR #3063 which was merged in PHPCS 3.5.7 effectively "undoes" the PHP 8.0 tokenization for identifier names for PHPCS 3.x.

This updates the UtilityMethodTestCase::usesPhp8NameTokens() method to take this upstream change into account.

Upstream PR 3063 which was merged in PHPCS 3.5.7 effectively "undoes" the PHP 8.0 tokenization for identifier names for PHPCS 3.x, while it also includes backfilling the PHP 8.0 token constants.

In PHPCS 4.x the PHP 8.0 tokenization will be backfilled instead, but that PR has not yet been pulled.

This commit annotates the current change in the `Collections::nameTokens()` method and updates the unit tests for various token collections to handle this correctly as well.

Refs:
* squizlabs/PHP_CodeSniffer#3041
* squizlabs/PHP_CodeSniffer#3063
@jrfnl jrfnl force-pushed the collections/sync-with-phpcs-3.x-identifier-names branch from afc6674 to 91f2250 Compare September 21, 2020 00:03
…ndoing" the PHP 8.0 identifier name tokenization

Upstream PR 3063 which was merged in PHPCS 3.5.7 effectively "undoes" the PHP 8.0 tokenization for identifier names for PHPCS 3.x.

This updates the `UtilityMethodTestCase::usesPhp8NameTokens()` method to take this upstream change into account.
@jrfnl jrfnl merged commit 8d7d32e into develop Sep 21, 2020
@jrfnl jrfnl deleted the collections/sync-with-phpcs-3.x-identifier-names branch September 21, 2020 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant